var mongoose = require('mongoose')

var vacationSchema = mongoose.Schema({

    name: String,
    slug: String,
    sku: String,
    description: String,
    priceInCents: Number,
    tags: [String],
    inSeason: Boolean,
    available: Boolean,
    requireWaiver: Boolean,
    maxGuests: Number,
    notes: String,
    packagesSold: Number,
})


vacationSchema.methods.getDisplayPrice = function(){

    return '$' + (this.priceInCents/100).toFixed(2);
}

var Vacation = mongoose.model('vacation',vacationSchema)

module.exports = Vacation;
